﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data;
using AirLinq.Meta;
using AirLinq.Dynamic;

namespace AirLinqTest.LinqToSql {
	[Table(Name="fld_sql")]
	public class TestClass{
		[Column(Name="Name")]
		public string Name {
			get;
			set;
		}
		[Column(Name="ord")]
		public int N {
			get;
			set;
		}
		public TestClass(string name, int n){
			Name=name;
			N=n;
		}
	}
	public class TestMaterializer : IMaterializer<TestClass> {
		
		#region IMaterializer<TestClass> Members

		public TestClass Create(IDataRecord record) {
			return new TestClass("123", 2);
		}

		#endregion
	}
	public class TestDataContext : DataContext{

		public TestDataContext(IDbConnection con) : base(con){
		}
		public IQueryable<TestClass> Test {
			get{
				return GetTable<TestClass>();
			}
		}
	}
}
